TestMenu = {}

function TestMenu.Panel()
	local DermaPanel = vgui.Create( "DFrame" )
	DermaPanel:SetPos( 50, 50 )
	DermaPanel:SetSize( 300, 300 )
	DermaPanel:SetTitle( "Testing Derma Stuff" )
	DermaPanel:SetVisible( true )
	DermaPanel:SetDraggable( true )
	DermaPanel:ShowCloseButton( true )
	DermaPanel:MakePopup()

	local DermaButton = vgui.Create( "DButton", DermaPanel )
	DermaButton:SetText( "Kill Yourself" )
	DermaButton:SetPos( 25, 50 )
	DermaButton:SetSize( 150, 50 )
	DermaButton.DoClick = function()
		RunConsoleCommand( "kill" )
	end

	DermaButton.DoRightClick = function()
		RunConsoleCommand( "say I want CHEESE!" )
	end
	
	DermaPanel:RequestFocus( )
end

function onChat( playerindex, playername, text )
	if (text == "!testmenu") then
		TestMenu.Panel()
	end
end

hook.Add( "ChatText", "ChatTextHook", onChat )